package com.zmn.oms.persistence.interfaces.comment;

import com.zmn.oms.model.entity.comment.OrderComment;
import java.util.List;
import java.util.Set;

import org.apache.ibatis.annotations.Param;

public interface OrderCommentDao {

    /**
     * 通过主键查询评价
     * @param orderId
     * @return
     */
    OrderComment findCommentByKey(Long orderId);

    /**
     * 根据订单id查询订单评价信息
     * @param orderIdList 订单Id集合
     * @return 评价信息
     */
    List<OrderComment> listOrderCommentByOrderIdList(@Param("orderIdList") List<Long> orderIdList);

    /**
     * 根据订单id查询订单评价信息
     * @param orderIdList 订单Id集合
     * @return 评价信息
     */
    List<OrderComment> listOrderCommentByOrderIdListAndType(@Param("orderIdList") List<Long> orderIdList, @Param("type") Integer type);

    /**
     * 保存评价
     * @param orderComment
     */
    void insertOrderComment(OrderComment orderComment);

    /**
     * 修改评价
     * @param record
     * @return
     */
    int updateOrderComment(OrderComment record);

    /**
     * 追评
     * @param comment
     */
    void updateOrderCommentAppend(OrderComment comment);

    /**
     * 修改用户id
     * @param orderIdSet
     * @param newUserId
     */
    void updateUserIdByOrderIds(@Param("orderIdSet") Set<Long> orderIdSet, @Param("newUserId") Long newUserId);
}